import threading as td
import queue
import random
import time, os

# current_dir = os.getcwd()

# # 列出当前文件夹所有内容（包括文件和子目录）
# all_items = os.listdir(current_dir)

# # 过滤出文件（排除文件夹）
# files = [item for item in all_items if os.path.isfile(os.path.join(current_dir, item))]

# # 统计文件数量
# file_count = len(files)

# # 输出结果
# print(f"当前文件夹路径: {current_dir}")
# print(f"文件总数: {file_count}")
# print("文件名列表:")
# for file in files:
#     print(f"- {file}")

# import json

# # 定义变量
# a = 'all'
# b = ['str1', 'str2']
# c = 3
# d = {'dict1': 'd1', 'dict2': 'd2'}
# e = 'enter'

# # 保存到文件
# def save_to_json(filename):
#     data = {
#         'a': a,
#         'b': b,
#         'c': c,
#         'd': d,
#         'e': e
#     }
#     with open(filename, 'w', encoding='utf-8') as f:
#         json.dump(data, f, indent=4)  # indent 美化输出

# # 从文件加载
# def load_from_json(filename):
#     with open(filename, 'r', encoding='utf-8') as f:
#         loaded_data = json.load(f)
#     return (
#         loaded_data['a'],
#         loaded_data['b'],
#         loaded_data['c'],
#         loaded_data['d'],
#         loaded_data['e']
#     )

# # 测试
# save_to_json('save.json')
# a_loaded, b_loaded, c_loaded, d_loaded, e_loaded = load_from_json('save.json')

# # 验证
# print(a_loaded, type(a_loaded))  # all <class 'str'>
# print(b_loaded, type(b_loaded))  # ['str1', 'str2'] <class 'list'>
# print(c_loaded, type(c_loaded))  # 3 <class 'int'>
# print(d_loaded, type(d_loaded))  # {'dict1': 'd1', 'dict2': 'd2'} <class 'dict'>
# print(e_loaded, type(e_loaded))  # enter <class 'str'>

# # a = ['a', 'b', 'c', 'd']
# # a.insert (0, 'o')
# # print (a)

# num_dir = os.path.join (os.getcwd (), 'SystemFile', 'saveNum.json')
# with open(num_dir, 'r', encoding = 'UTF-8') as nd:
#     save_num = json.load (nd)['save_num']
# print (save_num)

print ("\033[38;5;129maaaaaaaaaa")